﻿namespace WordCloudClient.WpfConvert
{
    public class IconConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ResourceDictionary dic = new() { Source = new Uri("WordCloudClient;component/Themes/MenuIconDictionary.xaml", UriKind.Relative) };
            foreach (DictionaryEntry item in dic)
            {
                if (item.Key.ToString() == value.ToString())
                {
                    return item.Value!.ToString()!;
                }
            }
            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
